package com.blankii.androidlibrary.init


import androidx.navigation.fragment.findNavController
import com.blankii.androidlibrary.R
import com.blankii.androidlibrary.base.BaseBindingFragment
import com.blankii.androidlibrary.databinding.FragmentIndexBinding
import com.blankii.androidlibrary.exts.loge
import com.blankii.androidlibrary.fragments.UseBaseBindingDialogFragment
import com.blankii.androidlibrary.utils.ViewClickContinuousUtil


internal class IndexFragment :
    BaseBindingFragment<FragmentIndexBinding>(FragmentIndexBinding::inflate) {


    override fun onCreateInit() {

    }

    override fun onInitView() {
        binding.apply {
            ViewClickContinuousUtil.setViewConfig(
                binding.button4, 2, 2, object : ViewClickContinuousUtil.ClickContinuousCallback {
                    override fun success() {
                        "success".loge(TAG)
                    }

                    override fun currentCount(count: Int) {
                        "$count".loge(TAG)
                    }
                })

            button1.setOnClickListener {
                findNavController().navigate(R.id.action_indexFragment_to_infoFragment)
            }
            button2.setOnClickListener {
                findNavController().navigate(R.id.action_indexFragment_to_autoSizeFragment)
            }
            button3.setOnClickListener {
                findNavController().navigate(R.id.action_indexFragment_to_testFragment)
            }

            button5.setOnClickListener {
                UseBaseBindingDialogFragment().show(parentFragmentManager)
            }
        }
    }
}